package tests;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.util.ArrayList;

import org.junit.Before;
import org.junit.Test;

import utilities.GestoreLink;
import controllersUtilities.StylesController;

public class TestStylesController {

	StylesController controller = null;
	ArrayList<File> referenceFiles = null;
	ArrayList<File> testedFile = null;
	
	@Before
	public void createArrayFile(){
		File folder = new File(GestoreLink.getGestore().getElement("StyleSheets"));
		File[] listOfFiles = folder.listFiles();
		referenceFiles = new ArrayList<File>();
		for(File file : listOfFiles){
			if(file.getName().endsWith(".css")){
				referenceFiles.add(file);
			}	
		}		
	}
	
	@Test
	public void testGetAllStyles() {
		controller = new StylesController();
		testedFile = controller.getAllStyles();
		assertTrue(testedFile.equals(referenceFiles));
	}

}
